-
Notifications
You must be signed in to change notification settings - Fork 253
feat: [iceberg] Native scan by serializing FileScanTasks to iceberg-rust #2528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2528 +/- ##
============================================
+ Coverage 56.12% 59.05% +2.92%
- Complexity 976 1462 +486
============================================
Files 119 165 +46
Lines 11743 15060 +3317
Branches 2251 2504 +253
============================================
+ Hits 6591 8893 +2302
- Misses 4012 4899 +887
- Partials 1140 1268 +128 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
It is promising! |
227332c to
6966a12
Compare
# Conflicts: # native/Cargo.lock # spark/src/main/scala/org/apache/comet/rules/CometScanRule.scala
…eberg version back to 1.8.1 after hitting known segfaults with old versions.
## Which issue does this PR close? - Part of #1749. ## What changes are included in this PR? - Change `ArrowReaderBuilder::new` to be `pub` instead of `pub(crate)`. ## Are these changes tested? - No new tests for this. Currently being used in DataFusion Comet: apache/datafusion-comet#2528
# Conflicts: # docs/source/user-guide/latest/configs.md # native/Cargo.lock # native/Cargo.toml # native/core/Cargo.toml
andygrove
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mbutrovich. I took a first pass through, and this is looking great! I'd like to get this merged in as soon as we can pin to a commit in the official iceberg-rust repo, and then continue the review once it is merged.
I'm going to review the serde parts more carefully later today.
andygrove
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any reason not to go ahead and merge this as an experimental feature.
…llel test and setup workflows.
kazuyukitanimura
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still looking
spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala
Outdated
Show resolved
Hide resolved
spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala
Outdated
Show resolved
Hide resolved
…due to type limitations in Iceberg 1.5.2.
kazuyukitanimura
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is merged, but one more comment
| iceberg-version: [{short: '1.8', full: '1.8.1'}, {short: '1.9', full: '1.9.1'}, {short: '1.10', full: '1.10.0'}] | ||
| spark-version: [{short: '3.4', full: '3.4.3'}, {short: '3.5', full: '3.5.7'}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The profile now says to use Iceberg 1.5 with Spark 3.4, but we do not have 1.5 here. Not sure if it causes problems...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what we currently test with this PR:
| 3.4 | 3.5 | 4.0 | |
|---|---|---|---|
| 1.5.2 | CometIcebergNativeSuite CometFuzzIcebergSuite IcebergReadFromS3Suite (not run in CI due to MinIO container) | ||
| 1.8.1 | Iceberg Spark Tests Iceberg Spark Extensions Tests Iceberg Spark Runtime Tests | Iceberg Spark Tests Iceberg Spark Extensions Tests Iceberg Spark Runtime Tests CometIcebergNativeSuite CometFuzzIcebergSuite IcebergReadFromS3Suite (not run in CI due to MinIO container) | |
| 1.9.1 | Iceberg Spark Tests Iceberg Spark Extensions Tests Iceberg Spark Runtime Tests | Iceberg Spark Tests Iceberg Spark Extensions Tests Iceberg Spark Runtime Tests | |
| 1.10 | Iceberg Spark Tests Iceberg Spark Extensions Tests Iceberg Spark Runtime Tests | Iceberg Spark Tests Iceberg Spark Extensions Tests Iceberg Spark Runtime Tests | CometIcebergNativeSuite CometFuzzIcebergSuite IcebergReadFromS3Suite (not run in CI due to MinIO container) |
I leaned on newer versions for the Iceberg tests because as best as I could tell, never versions are a superset of the older versions. For the Comet-native tests we are running 1.5.2.
We should have a discussion of what we want to run long term, because right now tagging a PR [iceberg] makes CI take hours and causes so many parallel Iceberg suites that we start getting network timeouts (likely due to throttling).
This PR introduces a new approach for integrating Apache Iceberg with Comet using iceberg-rust, enabling fully-native Iceberg table scans without requiring changes to upstream Iceberg Java code.
Rationale for this change
I was inspired by @RussellSpitzer's recent talk and wanted to revisit the abstraction layer at which Comet integrates with Iceberg.
Our current
iceberg_compatapproach requires code changes in Iceberg Java to integrate with Parquet reader instantiation, creating a tight coupling between Comet and Iceberg. This PR instead works at theFileScanTasklayer after Iceberg's planning phase is complete. This enables fully-native Iceberg scans (similar to ournative_datafusionscans) without any changes in upstream Iceberg Java code.All catalog access and planning continues to happen through Spark's Iceberg integration (unchanged), but file reading is delegated to iceberg-rust, which provides better parallelism and integrates naturally with Comet's native execution engine.
What changes are included in this PR?
This implementation follows a similar pattern to
CometNativeScanExecfor regular Parquet files, but extracts and serializes Iceberg'sFileScanTaskobjects:Scala/JVM Side:
CometIcebergNativeScanExecoperator that replaces Spark's IcebergBatchScanExecFileScanTaskobjects from Iceberg's planning outputNative/Rust Side:
IcebergScanExecoperator that consumes serializedFileScanTaskobjectsFileIOandArrowReaderto read data filesHow are these changes tested?
CometIcebergNativeSuitewith basic scenarios, but also a number of challenging situations from the Iceberg Java test suiteCometFuzzIcebergSuitethat we can adapt to Iceberg-specific logicIcebergReadFromS3Suiteto test passing basic S3 credentialsBenefits over
iceberg_compatnative_datafusion, not constrained by Iceberg Java's reader designArrowReaderCurrent Limitations & Open Questions
ArrowReaderOptionsto benefit from previous work in Arrow-rs Support different TimeUnits and timezones when reading Timestamps from INT96 arrow-rs#7285iceberg_compatcode and its Iceberg Java entanglementRelated Work
Slides from the 10/9/25 Iceberg-Rust community call: iceberg-rust.pdf